package designMode.simpleFactoryPatttern;

/**
 * @ClassName PizzaStore
 * @Description
 * @Author LIBOFEI
 * @Date 2020/6/18 22:57
 * @Version 1.0
 **/
public class PizzaStore {

    SimplePizzaFactory factory;

    public PizzaStore(SimplePizzaFactory simplePizzaFactory){
        this.factory = simplePizzaFactory;
    }

    public Pizza orderPizza(String type){
        Pizza pizza;
        pizza = factory.createPizza(type);
        pizza.prepare();
        pizza.bake();
        pizza.cut();
        pizza.box();
        return pizza;
    }
}
